<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<div id="outsideShell">
			<div id="insideShell1">
				<img src="img/1.jpg" id="image">
			</div>
			<button type="button" onclick="doAction()"/>开始切换</button>
		</div>
	</body>
	<script type="text/javascript">
		function doAction(){
			var image =  document.getElementById('image')
			
			setInterval(function(){
				var result = getrandom();
				image.src = 'img/'+result+'.jpg'
			},100)
		}
		function getrandom(){
			while(true){
				var result = Math.floor(Math.random()*10);
				if(result!=0){
					break;
				}
			}
			return result;
		}
	</script>
</html>
